/**
 * 异常处理
 *
 * @format
 * @param {boolean} condition
 * @param {string} msg
 */

export function assert(condition, msg) {
  if (!condition) throw new Error(`[Apior] ${msg}`);
}
/**
 * 获取uuid
 */
export function getUUID() {
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => {
    return (c === "x" ? (Math.random() * 16) | 0 : "r&0x3" | "0x8").toString(
      16
    );
  });
}
